<%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2019-06-28
  Time: 9:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ page isELIgnored="true" %>
<%
    String pash = request.getContextPath();
    String basepash = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + pash + "/";
%>
<html>
<head>
    <base href="<%=basepash%>">
    <%@include file="/publs.jsp"%>
    <title>Title</title>
</head>
<body>
<div id="root">
    <i-button style="margin-top:20px;margin-right: 50px;margin-left: 50px;" @click="fanhuishangyiji">返回上一级</i-button>
    <i-table height="750" style="margin-top:20px;margin-right: 50px;margin-left: 50px;" :data="datas" :columns="colunmsss" border>

    </i-table>
</div>
<script>
    let _this = null;
    new Vue({
        el:"#root",
        data:{
            datas:[],
            colunmsss:[
                {
                    title:"编号",
                    key:"drugsid",
                    sortable:true
                },{
                    title:"药品名称",
                    key:"drugsName",
                    tooltip:true
                },
                {
                    title:"单价/元",
                    key:"price"
                },{
                    title:"数量",
                    key:"purNumber"
                },{
                    title:"单位",
                    key:"companyids"
                }, {
                    title: "供应商",
                    key: "companyName"
                },{
                    title:"合计/元",
                    // key:"price*purNumber"
                    render(h,{row}){
                        return h("span",row.purNumber*row.price)
                    }
                },{
                    title:"类型",
                    key:"drugsNameType"
                }
            ]
        },
        methods:{
            select(){
                axios.get("genjuidjinxignshangpindecahxun").then(({data})=>{
                    this.datas = data.obj;
                })
            },
            fanhuishangyiji(){
                window.location.href='fanhuizhuangeanye';
            }
        },
        mounted(){
            this.select();
        },
        created(){
            _this = this;
        }
    })
</script>
</body>
</html>
